<?php
/*
	提现
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
global $_RQ;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){	
	$_SESSION['forward_url']='jy_jibifee/index/';
	$_SESSION['indexurl']='jy_shopmilk/merchshop/';
	cfc('core')->checklogin();
	$return['item']=model('jy_merch/member')->getdetail($_SESSION['onemerchid']);
	$credit_types=credit_types();
	$pay=uni_setting('pay');
	foreach($credit_types as $k=>$cv){
		if($k>2){
			$prizeType[]=array(
				'id'=>$k,
				'title'=>$cv,
				'api'=>$pay['credit'.$k.'_api'],
				'data'=>$return['item']['credit'.$k],
			);
		}
	}
	$return['item']['credit_type']=$prizeType;
	$return['member']=cfc('core')->member_show($_SESSION['uid']);
	set_html('title','会员中心');
	exi($return);
}
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'merchid'=>$_SESSION['onemerchid'],'mid'=>$_SESSION['uid']);
	if($_RQ['type']){
		$params['type']=intval($_RQ['type']);
	}
    $orderby='createtime desc';
	$total='';
	$list=pdo_getslice('jy_jibifee_feelog',$params,array($pindex,$psize),$total,'','','id desc');
	if($list){
		foreach($list as &$item){
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
			$item['typetitle']=$this->feelog_type[$item['type']];
		}
	}
	$return['list']=$list;
	exi($return);
}
if($_RQ['op']=='upinfee'){
	if($_SESSION['uid']){	
		$res['red']=model('jy_jibifee/model')->upinfee();
		if($res['red']){
			$res['member']=cfc('core')->member_show($_SESSION['uid']);
		}else{
			$res='none';
		}
	}else{
		$res='none';
	}
	exi($res);
}